#include<iostream>
using namespace std;
int day=0;

int main(){
	int num=0;
	for(int i=1;i<=7;i++){
		int tmp1,tmp2;
		cin>>tmp1>>tmp2;
		if(tmp1+tmp2>num){
			num = tmp1+tmp2;
			day = i;
		}
	}
	cout<<day<<endl;
}
